package com.book.web.controller.system;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.book.common.core.controller.BaseController;
import com.book.common.core.page.TableDataInfo;
import com.book.system.domain.FeedBack;
import com.book.system.service.IFeedBackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Bigboss
 * @create 2024-11-10 13:58
 */
@Api(tags = "意见反馈管理")
@RestController
@RequestMapping("/system/feedBack")
public class SysFeedBackController extends BaseController {

    private final IFeedBackService feedBackService;

    public SysFeedBackController(IFeedBackService feedBackService) {
        this.feedBackService = feedBackService;
    }

    /**
     * 获取反馈列表
     * @return
     */
    @ApiOperation(value = "获取反馈列表，权限：system:feedBack:list")
    @PreAuthorize("@ss.hasPermi('system:feedBack:list')")
    @GetMapping("/list")
    public TableDataInfo list()
    {
        startPage();
        return getDataTable(feedBackService.list(new LambdaQueryWrapper<FeedBack>().orderByAsc(FeedBack::getCreateTime)));
    }
}
